import com.demo.component.BeanLifeComponent;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author krystal
 * @date 2023/3/7 8:28
 */
public class App2 {
    public static void main(String[] args) {
        ClassPathXmlApplicationContext context=new ClassPathXmlApplicationContext("spring-config.xml");
        BeanLifeComponent beanLifeComponent=context.getBean("beanLifeComponent",BeanLifeComponent.class);
        System.out.println("使用Bean");
        //销毁Bean
        context.destroy();
    }
}
